projeter <- function(DATA, classes = NULL)
{
	if(!is.matrix(DATA) && !is.data.frame(DATA))
		stop("DATA must be a data frame or a matrix")
	data <- as.matrix(DATA)
	proj <- princomp(data, cor=TRUE)
	x <- proj$scores[,1]
	y <- proj$scores[,2]
	z <- proj$scores[,3]

	if(is.null(classes))
		colo <- rainbow(length(x))
	else
	{
		classes <- as.character(classes)
		class2 <- unique(classes)
		nbclass<-length(class2)

		aux <- rainbow(2*nbclass)
		iaux <- seq(1, 2*nbclass, 2)
		aux <- aux[iaux]
		res <- classes
		for(i in 1: nbclass)
		{
			res[res==class2[i]]<-aux[i]
		}
		colo <- res
	}

	open3d(windowRect=c(100,100,500,500))
	abclines3d(c(0,0,0),c(0,0,0),c(0,0,0),c(1,0,0),c(0,1,0),c(0,0,1), color="#000000")
	spheres3d(x,y,z, radius = 0.25, 
					 color = colo  )
}